<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>货品信息编辑</title>
</head>
<link rel="stylesheet" type="text/css" href="/wms/js/plugins/jquery-easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="/wms/js/plugins/jquery-easyui/themes/icon.css">
<script type="text/javascript" src="/wms/js/plugins/jquery-easyui/jquery.min.js"></script>
<script type="text/javascript" src="/wms/js/plugins/jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/wms/js/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="/wms/js/common/common.js"></script>
<script type="text/javascript">
/*校验规则*/
$(function() {
	$(":input[name='product.sn']").textbox({});
	$(":input[name='product.name']").textbox({
		required:true,
		missingMessage:'名称必填'
	});
	$(":input[name='product.costPrice']").numberbox({
		required:true,
		missingMessage:'成本价必填'
	});
	$(":input[name='product.salePrice']").numberbox({
		required:true,
		missingMessage:'销售价必填'
	});
	$(":input[name='product.brand.id']").combobox({
		width:140,
		panelHeight:null,
		editable:false
	});
	$(":input[name='image']").filebox({
		width:230
	});
	$(":input[name='product.intro']").textbox({
		width:300,
		height:150,
		multiline:true
	});
});
</script>
<body>

	<s:if test="hasActionErrors()">
		<script type="text/javascript">
			$.messager.alert('操作提示', '<s:property value="actionErrors[0]"/>', 'error');
		</script>
	</s:if>
	<form id="editForm" method="POST" action="/wms/product_saveOrUpdate.action" enctype="multipart/form-data">
		<s:hidden name="product.id"/>
		<table style="table-layout: fixed;">
			<s:if test="product.id != null">
				<tr>
					<td width="70px">货品编码</td>
					<td><s:textfield name="product.sn" readonly="true"/></td>
				</tr>
			</s:if>
			<tr>
				<td>货品名称</td>
				<td><s:textfield name="product.name"/></td>
			</tr>
			<tr>
				<td>成本价</td>	
				<td><s:textfield name="product.costPrice"/></td>
			</tr>
			<tr>
				<td>销售价</td>	
				<td><s:textfield name="product.salePrice"/></td>
			</tr>
			<tr>
				<td>所属品牌</td>	
				<td><s:select name="product.brand.id" list="#brands" listKey="id" listValue="name"/></td>
			</tr>
			<tr>
				<td>货品图片</td>	
				<td>
					<input name="image"/>
					
				</td>
				<td><img src="<s:property value='product.smallImagePath'/>" alt="暂无图片" /></td>
			</tr>
			<tr>
				<td>货品简介</td>	
				<td><s:textarea name="product.intro" rows="4" cols="6"/></td>
			</tr>
			
			<tr>
				<td></td>
				<td>
					<a class="easyui-linkbutton" data-options="text:'保存',iconCls:'icon-ok',onClick:saveOrUpdate"></a>
					<a class="easyui-linkbutton" data-options="text:'取消',iconCls:'icon-cancel',onClick:cancel"></a>
				</td>
			</tr>
			
		</table>
		<br />
	</form>

</body>
</html>
